<?php
/**
 * This file is part of Task Agile.
 * Task Agile is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 * Task Agile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Task Agile.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category   TaskAgile
 * @package    Controller
 * @copyright  Copyright (c) 20010-2010 Estrada Virtual (http://estradavirtual.com.br)
 * @license    http://www.gnu.org/licenses/gpl.txt GPLv3
 * @version    $Id$
*/
?>
<table width="100%" border="2px">
<?php
$projectCurrent    = null;
$enterpriseCurrent = null;
foreach ($this->tasks as $task) {
    if ($task->fk_enterprise !== $enterpriseCurrent) :
        $enterpriseCurrent = $task->fk_enterprise; ?>
            <tr>
                <th colspan="7">Empresa: <b><?php echo $task->enterpriseName; ?></b></th>
            </tr>
    <?php
    endif;
    if ($task->fk_project !== $projectCurrent) :
        $projectCurrent = $task->fk_project; ?>
            <tr>
                <th colspan="2">&nbsp;&nbsp;</th>
                <th colspan="5">Projeto: <b><?php echo $task->projectName; ?></b></th>
            </tr>
            <tr>
                <th colspan="3">&nbsp;&nbsp;</th>
                <th>Tarefa</th>
                <th>Responsável</th>
                <th>Situação</th>
                <th>Prioridade</th>
            </tr>
    <?php endif; ?>
            <tr>
                <td colspan="3">&nbsp;&nbsp;</td>
                <td><?php echo $task->name; ?></td>
                <td><?php echo $this->users[$task->fk_user]; ?></td>
                <td><?php echo $this->status[$task->status]; ?></td>
                <td><?php echo $this->prioritys[$task->priority]; ?></td>
            </tr>
<?php
}
?>
</table>